package com.mytx.sso.service;

import com.alibaba.fastjson.JSONObject;
import com.mytx.common.pojo.CommonResult;
import com.mytx.pojo.Contact;
import com.mytx.pojo.User;

import org.springframework.web.bind.annotation.*;

public interface UserService {


    /**
     * frign 还不支持@RequestParm 后面传入pojo 实体类
     *
     * @param
     * @return
     */
    @PostMapping("/register")
    CommonResult restRegister(@RequestParam("mobileCode") String mobileCode, @RequestBody User user) throws Exception;

    @RequestMapping(value = "login_v1", method = RequestMethod.POST)
    CommonResult restLogin(@RequestBody User requestBody);

    /**
     * 更新用户信息
     *
     * @param user
     * @return
     */
    @RequestMapping(value = "/upDateUser", method = RequestMethod.POST)
    User upDateUserInfo(@RequestBody User user);


    @RequestMapping(value = "/getContacts", method = RequestMethod.POST)
    CommonResult getContacts(@RequestParam("token") String token);


    @RequestMapping(value = "/autoLogin", method = RequestMethod.POST)
    CommonResult autoLogin();

    /**
     * 授权用户设置手机号和密码
     * @param body
     * @return
     */
    @RequestMapping(value = "/userBindAccount",method = RequestMethod.POST)
    CommonResult userBindAccount(@RequestBody JSONObject body);
}
